package com.ylm.wurao.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.github.pagehelper.PageInfo;
import com.ylm.wurao.model.User;
import com.ylm.wurao.service.UserService;

@Controller
@RequestMapping(value="/home")
public class Beetl2Controller {
	private final Logger logger=LoggerFactory.getLogger(getClass());
	
	 @Autowired
	 private UserService userService;

	 
	@RequestMapping(value="/add")
	public ModelAndView add(){
		ModelAndView mav=new ModelAndView();
		logger.info("------------ 加载 beetl模版————————————————");
		PageInfo<User> user=userService.findAllUser(0, 6);
		
		
		mav.addObject("title", "wurao_进阶之路");
		mav.addObject("page",user);
		mav.setViewName("add");
		return mav;
	}
}
